# celery的入口
import os

from celery import Celery

if not os.getenv('DJANGO_SETTING_MODULE'):
    os.environ['DJANGO_SETTINGS_MODULE'] = 'meiduo_mall.settings.dev'

# 创建celery实例(生产者)
celery_app = Celery("meiduo")

# 加载配置
celery_app.config_from_object('celery_tasks.config')

# 注册任务
celery_app.autodiscover_tasks([
    'celery_tasks.sms',
    'celery_tasks.email',
])
